package com.qf.listener;

import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "test",consumerGroup = "test-consumer-group1")
public class Consumer2 implements RocketMQListener<Message> {
    @Override
    public void onMessage(Message message) {
        byte[] body = message.getBody();
        System.out.println("Consumer2:消息数据:" + new String(body));
    }
}
